import http from '../../utils/request/request'
const URL = '/processing/processing-craft';

// 查询所有工艺
export function getAllInfo() {
    return http({
        url: '/processing/processing-craft',
        method: 'get'
    })
}
// 分页获取所有工艺
export function getAllInfoByPage(id,page = 1, size = 5) {
    return http({
        url: `${URL}/factory/${id}/page/${page}/${size}`,
        method: 'get'
    })
}

// 根据工艺名获取工艺
export function getInfoByName(value,page = 1, size = 5) {
    return http({
        url: `${URL}/page/${page}/${size}/query/${value}`,
        method: 'get'
    })
}

export function getInfoById(id) {
    return http({
        url: `${URL}/${id}`,
        method: 'get'
    })
}

// 增加工艺
export function addInfo(data) {
    return http({
        url: `${URL}/`,
        method: 'post',
        data,
    })
}

// 删除工艺
export function delInfoById(id) {
    return http({
        url: `${URL}/${id}`,
        method: 'delete'
    })
}

// 修改工艺信息
export function editInfo(data) {
    return http({
        url: `${URL}/`,
        method: 'put',
        data,
    })
}